<template>
	<view class="box">
		<view class="head">FKM</view>
		<view class="item">
			<view class="nei">
				<view class="phort">手机号</view>
				<input type="text" placeholder="135 2256 6762" class="num" v-model="query.username">
				<input type="text" placeholder="请输入密码" class="mima" v-model="query.pass">
			</view>
			<view class="btn" @click="addCou">登录</view>
			<view class="fles">
				<checkbox-group>
					<label>
						<checkbox  @click="isshow=!isshow"/>
					</label>

				</checkbox-group>
				<view class="ring">我已阅读并同意</view>
				<view class="red">《FKM用户协议》，《FKM隐私政策》</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		checkLogin
	} from '@/apis/index.js'
	export default {
		data() {
			return {
				query: {
					username: "admin",
					pass: "admin"
				},
				isshow:false,
			};
		},
		// onLoad() {
		// 	this.getcheckLogin()
		// },
		methods: {
			async addCou() {
				if (!this.query.username) {
					return uni.showToast({
						title: '手机号不能为空',
						icon: 'error'
					})
				}
				if (!this.query.pass) {
					return uni.showToast({
						title: '密码不能为空',
						icon: 'error'
					})
				}
				if(this.isshow==false){
					return uni.showToast({
						title:'请选中协议框',
						icon:'error'
					})
				}
				let res = await checkLogin(this.query)
				console.log(res);
				uni.navigateTo({
					url:'/pages/fitness/fitness'
				})
			},
		}
	}
</script>

<style lang="less">
	@import url('@/static/course.less');
</style>